/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.impl;

import java.util.List;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.hl7.v3.StrucDocCaption;
import org.hl7.v3.StrucDocRenderMultiMedia;
import org.hl7.v3.V3Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Struc Doc Render Multi Media</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.hl7.v3.impl.StrucDocRenderMultiMediaImpl#getCaption <em>Caption</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocRenderMultiMediaImpl#getID <em>ID</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocRenderMultiMediaImpl#getLanguage <em>Language</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocRenderMultiMediaImpl#getReferencedObject <em>Referenced Object</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocRenderMultiMediaImpl#getStyleCode <em>Style Code</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class StrucDocRenderMultiMediaImpl extends EObjectImpl implements StrucDocRenderMultiMedia {
	/**
	 * The cached value of the '{@link #getCaption() <em>Caption</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCaption()
	 * @generated
	 * @ordered
	 */
	protected StrucDocCaption caption;

	/**
	 * The default value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected static final String ID_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected String iD = ID_EDEFAULT;

	/**
	 * The default value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected static final String LANGUAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected String language = LANGUAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getReferencedObject() <em>Referenced Object</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferencedObject()
	 * @generated
	 * @ordered
	 */
	protected static final List<String> REFERENCED_OBJECT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getReferencedObject() <em>Referenced Object</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferencedObject()
	 * @generated
	 * @ordered
	 */
	protected List<String> referencedObject = REFERENCED_OBJECT_EDEFAULT;

	/**
	 * The default value of the '{@link #getStyleCode() <em>Style Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStyleCode()
	 * @generated
	 * @ordered
	 */
	protected static final List<String> STYLE_CODE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getStyleCode() <em>Style Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStyleCode()
	 * @generated
	 * @ordered
	 */
	protected List<String> styleCode = STYLE_CODE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected StrucDocRenderMultiMediaImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return V3Package.eINSTANCE.getStrucDocRenderMultiMedia();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StrucDocCaption getCaption() {
		return caption;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetCaption(StrucDocCaption newCaption, NotificationChain msgs) {
		StrucDocCaption oldCaption = caption;
		caption = newCaption;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION, oldCaption, newCaption);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCaption(StrucDocCaption newCaption) {
		if (newCaption != caption) {
			NotificationChain msgs = null;
			if (caption != null)
				msgs = ((InternalEObject)caption).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION, null, msgs);
			if (newCaption != null)
				msgs = ((InternalEObject)newCaption).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION, null, msgs);
			msgs = basicSetCaption(newCaption, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION, newCaption, newCaption));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getID() {
		return iD;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setID(String newID) {
		String oldID = iD;
		iD = newID;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__ID, oldID, iD));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLanguage() {
		return language;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLanguage(String newLanguage) {
		String oldLanguage = language;
		language = newLanguage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__LANGUAGE, oldLanguage, language));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public List<String> getReferencedObject() {
		return referencedObject;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setReferencedObject(List<String> newReferencedObject) {
		List<String> oldReferencedObject = referencedObject;
		referencedObject = newReferencedObject;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__REFERENCED_OBJECT, oldReferencedObject, referencedObject));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public List<String> getStyleCode() {
		return styleCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStyleCode(List<String> newStyleCode) {
		List<String> oldStyleCode = styleCode;
		styleCode = newStyleCode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__STYLE_CODE, oldStyleCode, styleCode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION:
				return basicSetCaption(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION:
				return getCaption();
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__ID:
				return getID();
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__LANGUAGE:
				return getLanguage();
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__REFERENCED_OBJECT:
				return getReferencedObject();
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__STYLE_CODE:
				return getStyleCode();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION:
				setCaption((StrucDocCaption)newValue);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__ID:
				setID((String)newValue);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__LANGUAGE:
				setLanguage((String)newValue);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__REFERENCED_OBJECT:
				setReferencedObject((List<String>)newValue);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__STYLE_CODE:
				setStyleCode((List<String>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION:
				setCaption((StrucDocCaption)null);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__ID:
				setID(ID_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__LANGUAGE:
				setLanguage(LANGUAGE_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__REFERENCED_OBJECT:
				setReferencedObject(REFERENCED_OBJECT_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__STYLE_CODE:
				setStyleCode(STYLE_CODE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__CAPTION:
				return caption != null;
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__ID:
				return ID_EDEFAULT == null ? iD != null : !ID_EDEFAULT.equals(iD);
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__LANGUAGE:
				return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language);
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__REFERENCED_OBJECT:
				return REFERENCED_OBJECT_EDEFAULT == null ? referencedObject != null : !REFERENCED_OBJECT_EDEFAULT.equals(referencedObject);
			case V3Package.STRUC_DOC_RENDER_MULTI_MEDIA__STYLE_CODE:
				return STYLE_CODE_EDEFAULT == null ? styleCode != null : !STYLE_CODE_EDEFAULT.equals(styleCode);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (iD: ");
		result.append(iD);
		result.append(", language: ");
		result.append(language);
		result.append(", referencedObject: ");
		result.append(referencedObject);
		result.append(", styleCode: ");
		result.append(styleCode);
		result.append(')');
		return result.toString();
	}

} //StrucDocRenderMultiMediaImpl
